<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }
        body{
            font-size: 14px;
        }
        .box{
            width: 240px;
            margin: 50px 50px;
            border: 1px solid #ccc;
            border-top: 1px dashed #ccc;
        }
        .box .dt{
            height: 20px;
            padding: 10px;
            line-height: 20px;
            border-bottom: 1px solid #ccc;
        }
        .box .dt h3{
            font-weight: normal;
            font-size: 14px;
            color: #666;
        }
        .box .dd{
            height: 240px;
        }
        .box .dd ul{
            list-style: none;
        }
        .box .dd ul li{
            float: left;
            width: 59px;
            height: 79px;
            text-align: center;
            border-bottom: 1px solid #ccc;
            border-right: 1px solid #ccc;
        }
        .box .dd ul li .i{
            position: relative;
            top:19px;
            margin: 0 auto;
            width: 25px;
            height: 25px;
            background: url(images/icon_lifeserv.png) no-repeat -25px 0;
        }
        .box .dd ul li a{
            position: relative;
            top: 25px;
            text-decoration: none;
            color: #666;
        }
        .box .dd ul li a:hover{
            color: #f00;
        }
    </style>
    <script>
        window.onload = function(){
            function $(id){return document.getElementById(id);}

            var lis = document.getElementsByClassName("lifeservi-icon1");
            var is = document.getElementsByClassName("i");

            for(var i=0;i<16;i++){
                is[i].style.backgroundPositionY = "-"+i*25+"px";
                if (i % 4 == 3)
                {
                    lis[i].style.borderRight = "none";
                }
                if ((i>=8)&&(i<=11)){
                    lis[i].style.borderBottom = "none";
                }
            }
        }
    </script>
</head>
<body>
    <div class="box">
        <div class="dt">
            <h3>生活服务</h3>
        </div>
        <div class="dd">
            <ul>
                <li class="lifeservi-icon1">
                    <div class="i"></div>
                    <a href="#">
                        <span>话费</span>
                    </a>
                </li>
                <li class="lifeservi-icon1">
                    <div class="i"></div>
                    <a href="#">
                        <span>机票</span>
                    </a>
                </li>
                <li class="lifeservi-icon1">
                    <div class="i"></div>
                    <a href="#">
                        <span>电影票</span>
                    </a>
                </li>
                <li class="lifeservi-icon1">
                    <div class="i"></div>
                    <a href="#" class="song">
                        <span>游戏</span>
                    </a>
                </li>
                <li class="lifeservi-icon1">
                    <div class="i"></div>
                    <a href="#">
                        <span>彩票</span>
                    </a>
                </li>
                <li class="lifeservi-icon1">
                    <div class="i"></div>
                    <a href="#">
                        <span>团购</span>
                    </a>
                </li>
                <li class="lifeservi-icon1">
                    <div class="i"></div>
                    <a href="#">
                        <span>酒店</span>
                    </a>
                </li>
                <li class="lifeservi-icon1">
                    <div class="i"></div>
                    <a href="#">
                        <span>水电煤</span>
                    </a>
                </li>
                <li class="lifeservi-icon1">
                    <div class="i"></div>
                    <a href="#">
                        <span>众筹</span>
                    </a>
                </li>
                <li class="lifeservi-icon1">
                    <div class="i"></div>
                    <a href="#">
                        <span>理财</span>
                    </a>
                </li>
                <li class="lifeservi-icon1">
                    <div class="i"></div>
                    <a href="#">
                        <span>礼品卡</span>
                    </a>
                </li>
                <li class="lifeservi-icon1">
                    <div class="i"></div>
                    <a href="#">
                        <span>白条</span>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</body>
</html>